<template>
  <div ref="chartRef" :style="{ width: '280px', height: '210px' }"></div>
</template>
<script lang="ts">
import { defineComponent, onMounted, ref, Ref, reactive } from 'vue';
import { useECharts } from '/@/hooks/web/useECharts';
export default defineComponent({
  name: 'bar1',
  props: {
    chartData: {
      type: Array,
      default: () => [],
    },
    // update-begin--author:liaozhiyang---date:20240407---for：【QQYUN-8762】首页默认及echars颜色调整
    seriesColor: {
      type: String,
      default: '#1890ff',
    },
    // update-end--author:liaozhiyang---date:20240407---for：【QQYUN-8762】首页默认及echars颜色调整
  },
  setup(props) {
    const chartRef = ref<HTMLDivElement | null>(null);
    const { setOptions } = useECharts(chartRef as Ref<HTMLDivElement>);


    onMounted(() => {
      // let sum = eval(echartsdata.map((item) => item.value).join('+'));

      setOptions(option);
    });

    return { chartRef };
  },
});
</script>
